<?php
/* +----------------------------------------------------------------------
 * 作	者: venus <venus-wxp@outlook.com>
 +----------------------------------------------------------------------
 * 创建日期: 2017/11/15 17:00
 +----------------------------------------------------------------------
 * 文件描述: 用于第一次使用系统恢复数据
 +----------------------------------------------------------------------
 * 升级记录:
 +----------------------------------------------------------------------
 */

use cn\ixiaopeng\backup\Backup;

$backup = new Backup();
$files = $backup->getSqlFileList(false);
$sqlFile = $files[0]['name'];
$str = $backup->restore($sqlFile);
$str = sprintf('<script>window.alert("%s");</script>', $str);
echo $str;